<template>
	<view class="content">
		<view class="vm-chunk" v-for="(item,index) in dataList" :key="index">
			<view class="vm-chunk-title" @click="spreadCli(index)">{{item.createTime}}<view class="vm-chunk-title-image" :class="spreadArr[index].value===1?'':'vm-chunk-title-rotate'"></view></view>
			<view class="vm-chunk-content" :class="spreadArr[index].value===1?'vm-chunk-contentOpen':'vm-chunk-contentClose'">
				<uni-list class="vm-chunk-content-list" :border="false">
					<uni-list-item title="维修人" :rightText="iten.name"></uni-list-item>
					<view class="vm-chunk-content-list-chunk">
						<view>联系电话</view>
						<view class="vm-chunk-content-list-chunk-rig" @click="phoneCli()">18888888888<view class="vm-chunk-content-list-chunk-rig-ico"><uni-icons type="phone" color="#fff" size="12"></uni-icons></view></view>
					</view>
					<uni-list-item title="维修时间" rightText="主馆-1F-1号门"></uni-list-item>
					<uni-list-item title="保修内容" rightText="F1号出口西号出口西号出口西号出口西号出口西号出口西号出口西号出口西号出口西号出口西号出口西号出口西号出口西"></uni-list-item>
					<view class="vm-chunk-content-list-chunk">
						<view>照片&视屏</view>
						<view class="vm-chunk-content-list-chunk-rig">
							 <image class="vm-chunk-content-list-chunk-rig-image" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg"></image>
							 <image class="vm-chunk-content-list-chunk-rig-image" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg"></image>
						</view>
					</view>
					<uni-list-item title="保修录音" rightText="102-1	F1号出口西"></uni-list-item>
					<uni-list-item title="维修完成时间" rightText="102-1	F1号出口西"></uni-list-item>
				</uni-list>
			</view>
		</view>
	</view>
</template>

<script>
	import {getMaintenanceDetailsWx} from '../../../api/device/device.js'
  export default {
	  data(){
		  return{
			  spreadArr:[{value:1}],
			  dataList:[{code:"2025-02-02"}]
		  }
	  },
    onLoad(e) {
    	// this.findListFu(e.id)
    },
	methods:{
		findListFu(id){
			this.spreadArr=[]
			getMaintenanceDetailsWx().then(res=>{
				if(res.code===200){
					res.data.forEach((item,index)=>{this.spreadArr.push({value:index===0?1:0})})
					this.dataList=res.data
				}
			})
		},
		spreadCli(index){
			this.spreadArr[index].value=this.spreadArr[index].value===1?0:1
		},
		phoneCli(phone){
			uni.makePhoneCall({
				phoneNumber: phone
			});
		}
	}
  }
</script>
<style lang="scss">
  .content {
	 padding: 0 3%;
	 box-sizing: border-box;
	  .vm-chunk{
		  width: 100%;
		  padding: 20rpx;
		  box-sizing: border-box;
		  border-radius: 18rpx;
		  margin-top: 20rpx;
		  background: linear-gradient(to bottom,#edf9ff 0%,#fff 20%);
		  &-title{
			  font-size: 34rpx;
			  color: #000;
			  font-weight: 500;
			  line-height: 80rpx;
			  height: 80rpx;
			  position: relative;
			  &-image{
			   width: 60rpx;
			   height: 60rpx;
			   background: transparent url(../../../static/images/business/equipment-04.png) no-repeat;
			   background-size: 100% 100%;
			   position: absolute;
			   top: 10rpx;
			   right: 20rpx;
			  }
			  &-rotate{
				transform: rotate(180deg);
			  }
		  }
		  &-content{
			  &-list{
				  margin: 20rpx 0;
				  border-bottom:1px solid #e7f1fc;
				  &-chunk{
					  position: relative;
					  display: flex;
					  flex-direction: row;
					  padding: 24rpx 30rpx;
					  padding-left: 30rpx;
					  flex: 1;
					  overflow: hidden;
					  justify-content: space-between;
					  &-rig{
						  width: 66%;
						  display: flex;
						  flex-direction: row;
						  justify-content: flex-end;
						  align-items: center;
						  flex-wrap:wrap;
						  color: #999;
						  font-size: 24rpx;
						  &-ico{
							  width: 34rpx;
							  height: 34rpx;
							  border-radius: 100rpx;
							  line-height: 34rpx;
							  text-align: center;
							  background-color: #67c23a;
							  margin-left: 10rpx;
						  }
						  &-image{
							  width:170rpx; 
							  height:170rpx; 
							  background-color: #eeeeee;
							  border-radius: 10rpx;
							  margin: 6rpx;
						  }
					  }
				  }
			  }
		  }
		  &-contentOpen{
			  height: auto;
			  overflow: visible;
		  }
		  &-contentClose{
			height: 0;
			overflow: hidden;
		  }
	  }
	uni-button:after{
		border: none;
	}
	/deep/ .uni-list{
		background-color: transparent;
	}
	/deep/ .uni-list--border:after{
		background-color: transparent;
	}
	/deep/ .uni-list-item__extra{
	  width: 66%;
	}
  }
</style>